
function btn_query() {
    var start_date = $("#start-picker").val();
    var end_date = $("#end-picker").val();
    if(start_date ==""){
        alert("请填写开始日期");
        $("#start-picker").focus();
        return
    }
    if(end_date ==""){
        alert("请填写结束日期");
        $("#end-picker").focus();
        return
    }

    if (start_date != "")
        setTimeout("location.href='/o-list/?D1=" + start_date + "&D2=" + end_date + "'", 500);
}

function btn_sel() {
    var start_date = $("#start-picker").val();
    var end_date = $("#end-picker").val();
    if(start_date ==""){
        alert("请填写开始日期");
        $("#start-picker").focus();
        return
    }
    if(end_date ==""){
        alert("请填写结束日期");
        $("#end-picker").focus();
        return
    }

    if (start_date != "")
        setTimeout("location.href='/orderlist/1/?D1=" + start_date + "&D2=" + end_date + "'", 500);
}


function btn_query_back() {
    var start_date =$("#start-picker").val();
    var end_date = $("#end-picker").val();
    alert(start_date +"-"+ end_date);
     //document.cookie = "start_date='"+start_date+"'";
     //document.cookie ="end_date='"+end_date+"'";
     $.ajax({
              type:"POST",
              url:"/o-list/",
              //url:"/o-list/?sdate="+start_date+"&edate="+end_date,
              data:{start_date:start_date,end_date:end_date},
              dataType:"json",
              success:function(data){
                if(data.code ==1){
                     // alert("location.href='/olist/?D1="+start_date+"&D2="+end_date+"'")
                     setTimeout("location.href='/import/?D1="+start_date+"&D2="+end_date+"'",500);
                  }
               }
            });
}

function post_data(){
    Modal.confirm({
        msg:"是否继续？"
    }).on(function (e) {
        if(e==true){
            //alert("OKKKK");
            $.ajax({
                type:"POST",
                url:"http://apit.icibei.com/order-service/order/external/acceptReceiptItems",
                dataType:"json",
                success:function (data) {
                    alert(data);
                    if(data.code=='1'){
                        alert("操作成功!");
                    }
                    else{
                        alert("操作失败")
                    }
                }
            });
        }
    });
}
